home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIStreamConverterService.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  7KB  |  154 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIStreamConverterService.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIStreamConverterService_h__
  6. #define __gen_nsIStreamConverterService_h__
  7.  
  8.  
  9. #ifndef __gen_nsIInputStream_h__
  10. #include "nsIInputStream.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsIStreamListener_h__
  14. #include "nsIStreamListener.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21. #define NS_ISTREAMCONVERTER_KEY         "@mozilla.org/streamconv;1"
  22.  
  23. /* starting interface:    nsIStreamConverterService */
  24. #define NS_ISTREAMCONVERTERSERVICE_IID_STR "e086e1e2-40ff-4193-8b8c-bd548babe70d"
  25.  
  26. #define NS_ISTREAMCONVERTERSERVICE_IID \
  27.   {0xe086e1e2, 0x40ff, 0x4193, \
  28.     { 0x8b, 0x8c, 0xbd, 0x54, 0x8b, 0xab, 0xe7, 0x0d }}
  29.  
  30. /**
  31.  * The nsIStreamConverterService is a higher level stream converter factory
  32.  * responsible for locating and creating stream converters
  33.  * (nsIStreamConverter).
  34.  *
  35.  * This service retrieves an interface that can convert data from a particular
  36.  * MIME type, to a particular MIME type. It is responsible for any intermediary
  37.  * conversion required in order to get from X to Z, assuming direct conversion
  38.  * is not possible.
  39.  *
  40.  * @author Jud Valeski
  41.  * @see nsIStreamConverter
  42.  */
  43. class NS_NO_VTABLE nsIStreamConverterService : public nsISupports {
  44.  public: 
  45.  
  46.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTREAMCONVERTERSERVICE_IID)
  47.  
  48.   /**
  49.      * <b>SYNCRONOUS VERSION</b>
  50.      * Converts a stream of one type, to a stream of another type.
  51.      *
  52.      * Use this method when you have a stream you want to convert.
  53.      *
  54.      * @param aFromStream   The stream representing the original/raw data.
  55.      * @param aFromType     The MIME type of aFromStream.
  56.      * @param aToType       The MIME type of the returned stream.
  57.      * @param aContext      Either an opaque context, or a converter specific
  58.      *                      context (implementation specific).
  59.      * @return              The converted stream. NOTE: The returned stream
  60.      *                      may not already be converted. An efficient stream
  61.      *                      converter implementation will convert data on
  62.      *                      demand rather than buffering the converted data
  63.      *                      until it is used.
  64.      */
  65.   /* nsIInputStream convert (in nsIInputStream aFromStream, in string aFromType, in string aToType, in nsISupports aContext); */
  66.   NS_IMETHOD Convert(nsIInputStream *aFromStream, const char *aFromType, const char *aToType, nsISupports *aContext, nsIInputStream **_retval) = 0;
  67.  
  68.   /**
  69.      * <b>ASYNCRONOUS VERSION</b>
  70.      * Retrieves a nsIStreamListener that receives the original/raw data via its
  71.      * nsIStreamListener::OnDataAvailable() callback, then converts and pushes 
  72.      * the data to aListener.
  73.      *
  74.      * Use this method when you want to proxy (and convert) nsIStreamListener
  75.      * callbacks asynchronously.
  76.      *
  77.      * @param aFromType     The MIME type of the original/raw data.
  78.      * @param aToType       The MIME type of the converted data.
  79.      * @param aListener     The listener that receives the converted data.
  80.      * @param aCtxt         Either an opaque context, or a converter specific
  81.      *                      context (implementation specific).
  82.      * @return              A nsIStreamListener that receives data via its
  83.      *                      OnDataAvailable() method.
  84.      */
  85.   /* nsIStreamListener asyncConvertData (in string aFromType, in string aToType, in nsIStreamListener aListener, in nsISupports aContext); */
  86.   NS_IMETHOD AsyncConvertData(const char *aFromType, const char *aToType, nsIStreamListener *aListener, nsISupports *aContext, nsIStreamListener **_retval) = 0;
  87.  
  88. };
  89.  
  90. /* Use this macro when declaring classes that implement this interface. */
  91. #define NS_DECL_NSISTREAMCONVERTERSERVICE \
  92.   NS_IMETHOD Convert(nsIInputStream *aFromStream, const char *aFromType, const char *aToType, nsISupports *aContext, nsIInputStream **_retval); \
  93.   NS_IMETHOD AsyncConvertData(const char *aFromType, const char *aToType, nsIStreamListener *aListener, nsISupports *aContext, nsIStreamListener **_retval); 
  94.  
  95. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  96. #define NS_FORWARD_NSISTREAMCONVERTERSERVICE(_to) \
  97.   NS_IMETHOD Convert(nsIInputStream *aFromStream, const char *aFromType, const char *aToType, nsISupports *aContext, nsIInputStream **_retval) { return _to Convert(aFromStream, aFromType, aToType, aContext, _retval); } \
  98.   NS_IMETHOD AsyncConvertData(const char *aFromType, const char *aToType, nsIStreamListener *aListener, nsISupports *aContext, nsIStreamListener **_retval) { return _to AsyncConvertData(aFromType, aToType, aListener, aContext, _retval); } 
  99.  
  100. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  101. #define NS_FORWARD_SAFE_NSISTREAMCONVERTERSERVICE(_to) \
  102.   NS_IMETHOD Convert(nsIInputStream *aFromStream, const char *aFromType, const char *aToType, nsISupports *aContext, nsIInputStream **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Convert(aFromStream, aFromType, aToType, aContext, _retval); } \
  103.   NS_IMETHOD AsyncConvertData(const char *aFromType, const char *aToType, nsIStreamListener *aListener, nsISupports *aContext, nsIStreamListener **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncConvertData(aFromType, aToType, aListener, aContext, _retval); } 
  104.  
  105. #if 0
  106. /* Use the code below as a template for the implementation class for this interface. */
  107.  
  108. /* Header file */
  109. class nsStreamConverterService : public nsIStreamConverterService
  110. {
  111. public:
  112.   NS_DECL_ISUPPORTS
  113.   NS_DECL_NSISTREAMCONVERTERSERVICE
  114.  
  115.   nsStreamConverterService();
  116.  
  117. private:
  118.   ~nsStreamConverterService();
  119.  
  120. protected:
  121.   /* additional members */
  122. };
  123.  
  124. /* Implementation file */
  125. NS_IMPL_ISUPPORTS1(nsStreamConverterService, nsIStreamConverterService)
  126.  
  127. nsStreamConverterService::nsStreamConverterService()
  128. {
  129.   /* member initializers and constructor code */
  130. }
  131.  
  132. nsStreamConverterService::~nsStreamConverterService()
  133. {
  134.   /* destructor code */
  135. }
  136.  
  137. /* nsIInputStream convert (in nsIInputStream aFromStream, in string aFromType, in string aToType, in nsISupports aContext); */
  138. NS_IMETHODIMP nsStreamConverterService::Convert(nsIInputStream *aFromStream, const char *aFromType, const char *aToType, nsISupports *aContext, nsIInputStream **_retval)
  139. {
  140.     return NS_ERROR_NOT_IMPLEMENTED;
  141. }
  142.  
  143. /* nsIStreamListener asyncConvertData (in string aFromType, in string aToType, in nsIStreamListener aListener, in nsISupports aContext); */
  144. NS_IMETHODIMP nsStreamConverterService::AsyncConvertData(const char *aFromType, const char *aToType, nsIStreamListener *aListener, nsISupports *aContext, nsIStreamListener **_retval)
  145. {
  146.     return NS_ERROR_NOT_IMPLEMENTED;
  147. }
  148.  
  149. /* End of implementation class template. */
  150. #endif
  151.  
  152.  
  153. #endif /* __gen_nsIStreamConverterService_h__ */
  154.